package cn.cdut.yiwenqian.biz.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.cdut.yiwenqian.biz.interfaces.IPostManager;
import cn.cdut.yiwenqian.dao.interfaces.ITitleDao;
import cn.cdut.yiwenqian.dao.interfaces.ITitleTypeDao;
import cn.cdut.yiwenqian.entity.CdutPostTitles;
import cn.cdut.yiwenqian.entity.CdutPostTitletypes;
import cn.cdut.yiwenqian.util.MyPageToolVo;
@Service
@Transactional
public class PostManagerImpl implements IPostManager {

	@Resource
	private ITitleDao iTitleDao;
	@Resource
	private ITitleTypeDao iTitleTypeDao;
	@Override
	public MyPageToolVo<CdutPostTitles> findAllUesrsPage(Integer pageNum, Integer userId) {
		return iTitleDao.findAllTitleByUserId(userId, pageNum);
	}
	@Override
	public CdutPostTitletypes findTypeByName(String name) {
		return iTitleTypeDao.findTypeByName(name);
	}
	@Override
	public List<CdutPostTitletypes> findTypeByKeyword(String keyword) {
		return iTitleTypeDao.findTypeByKeyword(keyword);
	}
	@Override
	public void saveTitleType(CdutPostTitletypes cptt) {
		iTitleTypeDao.saveType(cptt);
		
	}

}
